<?php
// +----------------------------------------------------------------------
// | 费用管理
// +----------------------------------------------------------------------
declare (strict_types = 1);

namespace app\table\controller;

use app\mxadmin\AdminBase;
use app\table\service\TableService;
use app\core\Res;

class Table extends AdminBase
{
    /**
     * 费用管理视图
     * @return \think\response\View
     */
    public function index()
    {
        return view();
    }
    
    /**
     * 添加费用弹窗
     * @return \think\response\View
     */
    public function tableaddview()
    {
        return view();
    }

    /**
     * 添加费用弹窗
     * @return \think\response\View
     */
    public function fieldview()
    {
        return view();
    }

    /**
     * 添加费用弹窗
     * @return \think\response\View
     */
    public function addfieldview()
    {
        return view();
    }

    /**
     * @return \think\response\View
     */
    public function relationview()
    {
        return view();
    }

    /**
     * @return \think\response\View
     */
    public function selrelationview()
    {
        return view();
    }


    /**
     * 财务费用添加编辑
     * @return \think\response\View
     */
    public function addtable()
    {
        if (request()->isPost()){
            $params = input('param.');
            $list=TableService::addtable($params);
            if ($list['code']==1) {
                return $this->success($list['msg']);
            } else {
                return $this->error($list['msg']);
            }
        }
    }

    /**
     * 财务费用添加编辑
     * @return \think\response\View
     */
    public function addfield()
    {
        if (request()->isPost()){
            $params = input('param.');
            $list=TableService::addFiled($params);
            if ($list['code']==1) {
                return $this->success($list['msg']);
            } else {
                return $this->error($list['msg']);
            }
        }
    }

    /**
     * @return \think\response\View
     */
    public function addrelation()
    {
        if (request()->isPost()){
            $params = input('param.');
            $list=TableService::addRelation($params);
            if ($list['code']==1) {
                return $this->success($list['msg']);
            } else {
                return $this->error($list['msg']);
            }
        }
    }


    /**
     * 费用管理列表
     * @return \think\response\View
     */
    public function list()
    {
        $params = input('param.');
        $list=TableService::list($params);
        return $this->result($list);
    }

    /**
     * 费用管理列表
     * @return \think\response\View
     */
    public function selectlist()
    {
        $params = input('param.');
        $list=TableService::selectList($params);
        return $this->result($list);
    }

    /**
     * 费用管理列表
     * @return \think\response\View
     */
    public function actionlist()
    {
        $params = input('param.');
        $list=TableService::selectList($params);
        return $this->result($list);
    }

    /**
     * 费用管理列表
     * @return \think\response\View
     */
    public function fieldlist()
    {
        $params = input('param.');
        $list=TableService::fieldList($params);
        return $this->result($list);
    }

    /**
     * 费用管理列表
     * @return \think\response\View
     */
    public function relationlist()
    {
        $params = input('param.');
        $list=TableService::relationList($params);
        return $this->result($list);
    }

    /**
     * 支付方式列表
     * @return \think\response\View
     */
    public function fieldtype()
    {
        $list=Res::getConfig('cfg.fieldtype');
        return $this->result($list);
    }



    
}
